﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="entry_score.aspx.cs" Inherits="entry_score" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>



    <title>录入学生成绩</title>
    <style type="text/css">
        .auto-style1 {
            font-size: large;
        }
        .auto-style2 {
            text-align: center;
        }
        .auto-style3 {
            font-size: x-large;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <div class="auto-style2">
            <span class="auto-style3"><strong>录入学生成绩：</strong></span><br class="auto-style3" />
        <br />
            <span class="auto-style1">请选择班级：</span><asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="Sclass" DataValueField="Sclass" CssClass="auto-style1">
        </asp:DropDownList>
        </div>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT [Sclass] FROM [Student]"></asp:SqlDataSource>
        <div class="auto-style2">
        <br />
            <span class="auto-style1">请选择学期：</span><asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="term" DataValueField="term" CssClass="auto-style1">
        </asp:DropDownList>
        </div>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT distinct [term] FROM [Course]"></asp:SqlDataSource>
        <br />
        <br />
        <center>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Sno,Cno" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowPaging="True" AllowSorting="True">
            <AlternatingRowStyle BackColor="White" />
            <Columns>

                <asp:BoundField DataField="Sclass" HeaderText="班级" SortExpression="Sclass" />
                <asp:BoundField DataField="term" HeaderText="学期" SortExpression="term" />
                <asp:BoundField DataField="Sno" HeaderText="学号" SortExpression="Sno" ReadOnly="True" />


                

                 <asp:BoundField DataField="Sname" HeaderText="姓名" SortExpression="Sname" />
                <asp:BoundField DataField="Cno" HeaderText="课程号" ReadOnly="True" SortExpression="Cno" />
                <asp:BoundField DataField="Cname" HeaderText="课程名" SortExpression="Cname" />


                

                <asp:HyperLinkField DataNavigateUrlFields="Sno,Cno" DataNavigateUrlFormatString="entry_score_detail.aspx?Sno={0}&amp;Cno={1}" DataTextField="Sname" DataTextFormatString="录入学生{0}的成绩" HeaderText="录入成绩" />


                

            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
            </center>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT Student.Sclass, Course.term, Select_course.Sno, Student.Sname, Select_course.Cno, Course.Cname
FROM Student,Select_course,Course
WHERE Select_course.Sno =Student.Sno AND Select_course.Cno = Course.Cno AND Student.Sclass=@Sclass AND Course.term=@term AND student.Smajor=@major">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" DefaultValue="" Name="Sclass" PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="DropDownList2" DefaultValue="" Name="term" PropertyName="SelectedValue" />
                <asp:SessionParameter Name="major" SessionField="dept" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
